Collection Objects
Collection objects are repositories for additional information associated with the core printing-related objects. Each piece of information is called an item. The print collection objects are
Figure 1-13 on page 1-21 shows the items that QuickDraw GX defines for these collection objects. They are discussed completely in the chapter "Page Formatting and Dialog Box Customization" in this book.
- The job collection, which contains items of information that are relevant to a print job. These items include information about how to print the document; for example, how many copies, how to collate them, paper feed options, whether the document is to be printed to disk, and file information.
- The format collection, which contains items of information related to printing a page from the document. It specifies the orientation of a page, whether a halftone should be applied, the scale, and other items related to formatting a page.
- The paper-type collection, which contains items of information related to the kind of paper to which the format applies. For example, it specifies the base paper type, such as US letter or legal, and the units in which the paper is measured, such as inches or millimeters.
Typically, an item in a collection object is set by the printer driver. The user can change the item by setting values or controls in a dialog box. For example, the value in the copies information item of the job collection is set by the printer driver. The default Print dialog box allows the user to change the value. The value in the item is then used by the printer driver to determine how many times to print the pages associated with the job object.
You only need to be concerned about the information in collection objects in the following situations:
For an example of the first situation, to implement the Print One Copy menu item, you need to set the copies item in the job collection to 1 before printing and reset it to its previous value afterwards.
- when you are printing without dialog boxes and need to set an item in a collection object
- when you want to allow the user access to an item that is not provided by a printer driver in a dialog box
Consider the following example that applies to the second situation. The job object specifies the pages to print, which the printer driver uses, by default, in its Print dialog box. The job collection object provides a page-range information item that allows a complex range of pages to be specified. To support the complex page range, you must customize the Print dialog box to display the range from the collection item and store the new values back in the collection object when the user changes them. Of course, the printer driver must be set up to use the collection item too.
A printer driver can define additional items and store them in the appropriate collection. Your application can do likewise. You should consider whether these collections are appropriate for the kind of information you wish to manage. You can also create your own special-purpose collections. For more information about collections, see the Collection Manager chapter of Inside Macintosh: QuickDraw GX Environment and Utilities.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help